/*
https://leetcode.cn/problems/climbing-stairs/submissions/562111071/
70.爬楼梯



*/


class Solution {
public:
    int climbStairs(int n) {
        if(n==1)return 1;
        int a = 1, b = 1;
        int count=0 ;
        for (int i = 0; i < n-1; ++i) {
            
                count=a+b;
                a=b;
                b=count;
        }
        return count;
    }
};